package com.cast.n2.n3;

import lombok.extern.slf4j.Slf4j;

/**
 * @program: juc
 * @description:
 * @author: lishuang
 * @create: 2021-10-13 17:19
 **/
@Slf4j(topic = "c.Test8")
public class Test8 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            log.debug("sleep....");
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        },"t1");
        t.start();
        Thread.sleep(1000);
        log.debug("interrupt");
        t.interrupt();
        log.debug("打断标记:{}",t.isInterrupted());
    }
}